package lovo01.game;

import java.util.Scanner;

/**
 * 玩家类
 */
public class Player extends Role{
    Scanner sc = new Scanner(System.in);

    public Player(){

    }
    public Player(String name){
        this.setName(name);
    }

    /**
     * 玩家出拳的方法
     * @return
     */
    public int input(){
        while (true){
            System.out.println("玩家请选择：1-石头 2-剪刀 3-布");
            int mora = sc.nextInt();
            if (mora >= 1 && mora <= 2){
                return mora;
            }else{
                System.out.println("输入错误，请重新输入");
            }
        }
    }
}
